[LIBXC][POWERPC] make sure DTB is truncated and has a decent mode
authorJimi Xenidis <jimix@watson.ibm.com>
Thu, 8 Feb 2007 12:05:26 +0000 (07:05 -0500)
committerJimi Xenidis <jimix@watson.ibm.com>
Thu, 8 Feb 2007 12:05:26 +0000 (07:05 -0500)
Also, since we only write to this FD, we mau as well use creat(2)
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
--HG--
extra : transplant_source : %05%9B%EF%F4%12%9B%C0%FCD%03%2A%95%A8ull%A8%9Fk%21

tools/libxc/powerpc64/mk_flatdevtree.c

index 14af93336a73de3f10d2477837a2ada95a6f8eed..a6f1de9150437efb3ac3f3e11e5d2e55dd8609ef 100644 (file)
@@ -618,7 +618,7 @@ int make_devtree(struct ft_cxt *root,
     }
 
     /* write a copy of the tree to a file */
-    if ((dtb_fd = open(DTB_FILE , O_CREAT|O_RDWR)) == -1) {
+    if ((dtb_fd = creat(DTB_FILE, S_IRUSR | S_IWUSR)) == -1) {
         PERROR("%s: failed to open file %s", __func__, DTB_FILE);
         goto error;
     }